﻿@typeparam TValue
@inherits Blazorise.Check<TValue>
<label class="@WrapperClassNames">
    <span class="@CheckboxClassNames">
        <input @ref="@ElementRef" id="@ElementId" type="checkbox" class="@ClassNames" style="@StyleNames" disabled="@Disabled" readonly="@ReadOnly" checked="@CurrentValue" @onchange="@OnChangeHandler" @onfocus="@OnFocus" @onfocusin="@FocusIn" @onfocusout="@FocusOut" @attributes="@Attributes" />
        <span class="@InnerClassNames"></span>
    </span>
    <span>
        @ChildContent
        @Feedback
    </span>
</label>
@code{
    string WrapperClassNames
        => $"ant-checkbox-wrapper {( Checked?.ToString() == bool.TrueString ? "ant-checkbox-wrapper-pointer" : "" )}";

    string CheckboxClassNames
        => $"ant-checkbox {( Checked?.ToString() == bool.TrueString ? "ant-checkbox-checked" : "" )}";

    string InnerClassNames
        => $"ant-checkbox-inner";
}
